home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2003 December / The Sunday Times - The Month 2003-12.iso / pc / engine / shell / shell.swf / scripts / frame_2 / DoAction.as < prev   
Encoding:
Text File  |  2003-11-10  |  4.1 KB  |  150 lines

  1. function interrupt()
  2. {
  3.    if(intro != null)
  4.    {
  5.       intro._visible = false;
  6.    }
  7.    if(mc_credits != null)
  8.    {
  9.       mc_credits.interrupt();
  10.    }
  11. }
  12. function resume()
  13. {
  14.    if(intro != null)
  15.    {
  16.       intro._visible = true;
  17.    }
  18.    if(mc_credits != null)
  19.    {
  20.       mc_credits.resume();
  21.    }
  22. }
  23. function exit()
  24. {
  25.    if(blnInExit == true)
  26.    {
  27.       return undefined;
  28.    }
  29.    UsageData.setSoProp("soIssue","firstTimeIssueRun",false);
  30.    interrupt();
  31.    lingo("spriteDialog.show(\"exit\")");
  32.    blnInExit = true;
  33. }
  34. function creditsShow()
  35. {
  36.    Tardis.splash.endSoundLoop();
  37.    gotoAndStop(30);
  38.    ActiveSection = "credits";
  39.    header.clearUp();
  40.    footer.disable();
  41.    this.createEmptyMovieClip("mc_credits",Tardis.depth++);
  42.    mc_credits.loadMovie(ENGINE_FOLDER + "swf/credits.swf");
  43. }
  44. function creditsComplete()
  45. {
  46.    lingo("Flsh_exit");
  47. }
  48. function init()
  49. {
  50.    Settings = {};
  51.    xmlIssueData = new XML();
  52.    xmlIssueData.onLoad = function()
  53.    {
  54.       setupIssue();
  55.       delete setupIssue;
  56.       delete xmlIssueData;
  57.       UsageData.LOG_URL = Settings.tracking.log_url;
  58.       UsageData.PING_URL = Settings.tracking.ping_url;
  59.       with(UsageData)
  60.       {
  61.          init();
  62.          addPingEntry();
  63.          addSessionGroup();
  64.       }
  65.       delete UsageData.init;
  66.       ConnCheck.onTestComplete = function(success)
  67.       {
  68.          if(success)
  69.          {
  70.             with(Tardis.UsageData)
  71.             {
  72.                if(!active)
  73.                {
  74.                   checkSend();
  75.                }
  76.             }
  77.          }
  78.          else
  79.          {
  80.             Tardis.UsageData.dbg("no connection");
  81.          }
  82.       };
  83.       ConnCheck.TIMER_INTERVAL = Settings.tracking.interval;
  84.       ConnCheck.startTimer();
  85.       if(PLAY_MODE == "director")
  86.       {
  87.          gotoAndStop(11);
  88.       }
  89.       else
  90.       {
  91.          gotoAndStop(21);
  92.          footer.show();
  93.          header.clearUp();
  94.       }
  95.       delete Settings.tracking;
  96.       delete init;
  97.    };
  98.    xmlIssueData.load(ISSUE_XMLFILE);
  99. }
  100. function setupIssue()
  101. {
  102.    var ndRoot = xmlIssueData.firstChild;
  103.    ASSETS_FOLDER = ndRoot.byName("assets").getText();
  104.    ENGINE_FOLDER = ndRoot.byName("engine").getText();
  105.    lingo("spriteShell.setAssetsPath(\"" + ASSETS_FOLDER + "\")");
  106.    var ndSponsor = ndRoot.byName("sponsor");
  107.    var ndTracking = ndRoot.byName("tracking");
  108.    var ndDate = ndRoot.byName("date");
  109.    var ndSponsorVideo = ndSponsor.byName("video");
  110.    Sections = new SectionsList(ndRoot.byName("sections"));
  111.    delete SectionsList;
  112.    Colors = new ColorsObject(ndRoot.byName("colors"));
  113.    delete ColorsObject;
  114.    Settings = {issue_month:ndDate.attributes.month,issue_year:ndDate.attributes.year,version:ndRoot.byName("version").getText(),FEATURE_ASSETS:ASSETS_FOLDER + "bespoke/feature",introVideo:ndRoot.byName("introVideo").getText(),sponsor:{video:ndSponsorVideo.getText(),videoSkipDelay:ndSponsorVideo.attributes.skipdelay,overlay:ndSponsor.byName("overlay").getText(),overlayTint:ndSponsor.byName("overlayTint").getText(),button:ndSponsor.byName("button").getText()},tracking:{log_url:ndTracking.byName("log_url").getText(),ping_url:ndTracking.byName("ping_url").getText(),interval:ndTracking.byName("interval").getText()}};
  115. }
  116. blnInExit = false;
  117. connTardisReceive = new LocalConnection();
  118. connTardisReceive.exit_cancel = function()
  119. {
  120.    Tardis.blnInExit = false;
  121.    Tardis.footer.buttonReset("exit");
  122.    Tardis.resume();
  123. };
  124. connTardisReceive.UsageData_markExit = function()
  125. {
  126.    Tardis.UsageData.addPageEntry(99);
  127.    Tardis.UsageData.checkSend();
  128. };
  129. connTardisReceive.ConnCheck_stopTimer = function()
  130. {
  131.    Tardis.ConnCheck.stopTimer();
  132. };
  133. connTardisReceive.childlock_lock = function()
  134. {
  135.    Tardis.ChildLock.lock();
  136. };
  137. connTardisReceive.childlock_unlock = function()
  138. {
  139.    Tardis.ChildLock.unlock();
  140. };
  141. connTardisReceive.intro_nextState = function()
  142. {
  143.    Tardis.intro.nextState();
  144. };
  145. connTardisReceive.UsageData_setValue = function(strSoObject, strProp, val)
  146. {
  147.    Tardis.UsageData.setSoProp(strSoObject,strProp,val);
  148. };
  149. success = connTardisReceive.connect("Tardis");
  150.